const { defineConfig } = require('cypress')

module.exports = defineConfig({
  e2e: {
    baseUrl: 'http://localhost:8001', // 直接测试后端API
    supportFile: 'cypress/support/e2e.js',
    specPattern: 'cypress/e2e/**/*.cy.{js,jsx,ts,tsx}',
    viewportWidth: 375, // 移动端视口宽度
    viewportHeight: 667, // 移动端视口高度
    video: false,
    screenshotOnRunFailure: true,
    defaultCommandTimeout: 10000,
    requestTimeout: 10000,
    responseTimeout: 10000,
    env: {
      BACKEND_URL: 'http://localhost:8001', // 后端API地址
      TEST_ORDER_NO: 'TEST123',
      TEST_MACHINE_ID: 'M05',
      TEST_OPERATOR_ID: 'OP001'
    }
  },

  component: {
    devServer: {
      framework: 'vue',
      bundler: 'webpack',
    },
  },
})